3.3.76 \(\int \cot (c+d x) (a+b \sec (c+d x))^2 \, dx\) [276]

Optimal. Leaf size=61 \[ \frac {a^2 \log (\cos (c+d x))}{d}+\frac {(a+b)^2 \log (1-\sec (c+d x))}{2 d}+\frac {(a-b)^2 \log (1+\sec (c+d x))}{2 d} \]

[Out]

a^2*ln(cos(d*x+c))/d+1/2*(a+b)^2*ln(1-sec(d*x+c))/d+1/2*(a-b)^2*ln(1+sec(d*x+c))/d

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3970, 1816} \begin {gather*} \frac {a^2 \log (\cos (c+d x))}{d}+\frac {(a+b)^2 \log (1-\sec (c+d x))}{2 d}+\frac {(a-b)^2 \log (\sec (c+d x)+1)}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]*(a + b*Sec[c + d*x])^2,x]

[Out]

(a^2*Log[Cos[c + d*x]])/d + ((a + b)^2*Log[1 - Sec[c + d*x]])/(2*d) + ((a - b)^2*Log[1 + Sec[c + d*x]])/(2*d)

Rule 1816

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 3970

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[-(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[(b^2 - x^2)^((m - 1)/2)*((a + x)^n/x), x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \cot (c+d x) (a+b \sec (c+d x))^2 \, dx &=-\frac {b^2 \text {Subst}\left (\int \frac {(a+x)^2}{x \left (b^2-x^2\right )} \, dx,x,b \sec (c+d x)\right )}{d}\\ &=-\frac {b^2 \text {Subst}\left (\int \left (\frac {(a+b)^2}{2 b^2 (b-x)}+\frac {a^2}{b^2 x}-\frac {(a-b)^2}{2 b^2 (b+x)}\right ) \, dx,x,b \sec (c+d x)\right )}{d}\\ &=\frac {a^2 \log (\cos (c+d x))}{d}+\frac {(a+b)^2 \log (1-\sec (c+d x))}{2 d}+\frac {(a-b)^2 \log (1+\sec (c+d x))}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.12, size = 53, normalized size = 0.87 \begin {gather*} \frac {(a-b)^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-b^2 \log (\cos (c+d x))+(a+b)^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]*(a + b*Sec[c + d*x])^2,x]

[Out]

((a - b)^2*Log[Cos[(c + d*x)/2]] - b^2*Log[Cos[c + d*x]] + (a + b)^2*Log[Sin[(c + d*x)/2]])/d

________________________________________________________________________________________

Maple [A]
time = 0.11, size = 48, normalized size = 0.79

method result size
derivativedivides \(\frac {b^{2} \ln \left (\tan \left (d x +c \right )\right )+2 b a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )+a^{2} \ln \left (\sin \left (d x +c \right )\right )}{d}\) \(48\)
default \(\frac {b^{2} \ln \left (\tan \left (d x +c \right )\right )+2 b a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )+a^{2} \ln \left (\sin \left (d x +c \right )\right )}{d}\) \(48\)
risch \(-i a^{2} x -\frac {2 i a^{2} c}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b a}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{2}}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b a}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{2}}{d}-\frac {b^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(153\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)*(a+b*sec(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(b^2*ln(tan(d*x+c))+2*b*a*ln(csc(d*x+c)-cot(d*x+c))+a^2*ln(sin(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 62, normalized size = 1.02 \begin {gather*} -\frac {2 \, b^{2} \log \left (\cos \left (d x + c\right )\right ) - {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\cos \left (d x + c\right ) + 1\right ) - {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\cos \left (d x + c\right ) - 1\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*sec(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/2*(2*b^2*log(cos(d*x + c)) - (a^2 - 2*a*b + b^2)*log(cos(d*x + c) + 1) - (a^2 + 2*a*b + b^2)*log(cos(d*x +
c) - 1))/d

________________________________________________________________________________________

Fricas [A]
time = 2.42, size = 68, normalized size = 1.11 \begin {gather*} -\frac {2 \, b^{2} \log \left (-\cos \left (d x + c\right )\right ) - {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*sec(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/2*(2*b^2*log(-cos(d*x + c)) - (a^2 - 2*a*b + b^2)*log(1/2*cos(d*x + c) + 1/2) - (a^2 + 2*a*b + b^2)*log(-1/
2*cos(d*x + c) + 1/2))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cot {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*sec(d*x+c))**2,x)

[Out]

Integral((a + b*sec(c + d*x))**2*cot(c + d*x), x)

________________________________________________________________________________________

Giac [A]
time = 0.46, size = 101, normalized size = 1.66 \begin {gather*} -\frac {2 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) + 2 \, b^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) - {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*sec(d*x+c))^2,x, algorithm="giac")

[Out]

-1/2*(2*a^2*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1)) + 2*b^2*log(abs(-(cos(d*x + c) - 1)/(cos(d*x
+ c) + 1) - 1)) - (a^2 + 2*a*b + b^2)*log(abs(-cos(d*x + c) + 1)/abs(cos(d*x + c) + 1)))/d

________________________________________________________________________________________

Mupad [B]
time = 1.43, size = 96, normalized size = 1.57 \begin {gather*} \frac {a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {b^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {a^2\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d}-\frac {b^2\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}{d}+\frac {2\,a\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)*(a + b/cos(c + d*x))^2,x)

[Out]

(a^2*log(tan(c/2 + (d*x)/2)))/d + (b^2*log(tan(c/2 + (d*x)/2)))/d - (a^2*log(tan(c/2 + (d*x)/2)^2 + 1))/d - (b
^2*log(tan(c/2 + (d*x)/2)^2 - 1))/d + (2*a*b*log(tan(c/2 + (d*x)/2)))/d

________________________________________________________________________________________